package ll.sms.business;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class SmsThreadPool {

	static ExecutorService pool=null;

	public static void main(String[] args) {
		pool  = Executors.newCachedThreadPool();
		
		pool.execute(getTask());
		//pool.
		//Executors.
		System.out.println("over");
	}
	
	public static Runnable getTask(){
		return Executors.defaultThreadFactory().newThread(new SmsThreadPool().new MyTask());
	}
	
	class MyTask implements Runnable{
	
		public void run() {
			for (int i = 0; i < 100; i++) {
				System.out.println(i);
				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			
		}
	}

	
}
